﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Ocorrencia.aspx.cs" Inherits="Ocorrencia" Title=".:: SIGOT - Ocorrência" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:Panel ID="Panel5" runat="server" 
        style="z-index: 1; left: 0px; top: 0px; position: absolute; height: 19px; width: 955px">
        <asp:Label ID="Label2" runat="server" Text="Cadastro:" Font-Bold="True" 
            Font-Names="Trebuchet MS" Font-Size="10pt" ForeColor="#000099"></asp:Label>
    </asp:Panel>
    <p>
        <br />
    </p>
    <p style="margin-left: 40px">
        <asp:Button ID="Button2" runat="server" 
            style="z-index: 1; left: 19px; top: 30px; position: absolute; height: 27px; width: 133px" 
            Text="        Nova Ocorrência" Font-Size="9pt" onclick="Button2_Click" />
        <asp:Image ID="Image12" runat="server" 
            
            style="z-index: 1; left: 21px; top: 32px; position: absolute; width: 24px; height: 22px; right: 910px;" 
            ImageUrl="~/imagens/fatia/formulario/adicionar.png" />
    </p>
    <p>
        <asp:Image ID="Image13" runat="server" 
            ImageUrl="~/imagens/fatia/masterPage/linha_horizontal.png" 
            
            
            
            style="z-index: 1; left: 5px; top: 66px; position: absolute; height: 3px; width: 946px;" />
    </p>
    <asp:Panel ID="Panel6" runat="server" 
        style="z-index: 1; left: 0px; top: 75px; position: absolute; height: 19px; width: 955px">
        <asp:Label ID="Label4" runat="server" Text="Pesquisa:" Font-Bold="True" 
            Font-Names="Trebuchet MS" Font-Size="10pt" ForeColor="#000099"></asp:Label>
    </asp:Panel>
    <p>
    </p>
    <p>
        <asp:TextBox ID="filtro" runat="server" 
            
            style="z-index: 1; left: 63px; top: 104px; position: absolute; height: 19px; width: 263px; right: 629px;"></asp:TextBox>
        <asp:Button ID="Button1" runat="server" Font-Size="9pt" 
            style="z-index: 1; left: 333px; top: 101px; position: absolute; height: 27px; width: 154px" 
            Text="        Pesquisar Ocorrência" onclick="Button1_Click" />
        <asp:Image ID="Image14" runat="server" 
            ImageUrl="~/imagens/fatia/formulario/pesquisar.png" 
            
            style="z-index: 1; left: 338px; top: 102px; position: absolute; height: 22px; width: 23px" />
            <asp:Panel ID="Panel8" runat="server" 
                
                
                
        style="z-index: 1; left: 63px; top: 155px; position: absolute; height: 19px; width: 323px">
                <asp:Label ID="lbl_mensagem" runat="server" Font-Bold="True" 
                    Font-Names="Trebuchet MS" ForeColor="Red" 
                    Text="Não há registros com o nome informado!" Visible="False" 
                    Enabled="False"></asp:Label>
            </asp:Panel>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:SIGOTConnectionString %>" 
            
        SelectCommand="SELECT ocorrencia.numero, bairro.nome AS bairro, status_ocorrencia.descricao AS status, tipo_ocorrencia.descricao AS tipo_ocorrencia, ocorrencia.vitimas_feridas, ocorrencia.vitimas_fatais, ocorrencia.data_hora FROM ocorrencia INNER JOIN solicitante ON ocorrencia.solicitante_id = solicitante.id INNER JOIN usuario ON ocorrencia.usuario_matricula = usuario.matricula INNER JOIN local ON ocorrencia.local_id = local.id INNER JOIN logradouro ON local.logradouro_id = logradouro.id INNER JOIN bairro ON logradouro.bairro_codigo = bairro.codigo INNER JOIN status_ocorrencia ON ocorrencia.status_ocorrencia_codigo = status_ocorrencia.codigo INNER JOIN tipo_ocorrencia ON ocorrencia.tipo_ocorrencia_codigo = tipo_ocorrencia.codigo INNER JOIN turno ON ocorrencia.turno_codigo = turno.codigo WHERE (status_ocorrencia.descricao LIKE @status + '%')">
            <SelectParameters>
                <asp:ControlParameter ControlID="filtro" DefaultValue="Em Espera" Name="status" 
                    PropertyName="Text" />
            </SelectParameters>
        </asp:SqlDataSource>
    </p>
            <asp:GridView ID="GridView1" runat="server" AllowSorting="True" 
                AutoGenerateColumns="False" BorderColor="#DEDFDE" BorderWidth="1px" 
                CellPadding="1" DataKeyNames="numero" DataSourceID="SqlDataSource1" 
                ForeColor="Black" GridLines="Vertical" Height="0px" 
                HorizontalAlign="Left" ShowFooter="True" style="z-index: 1; 
        left: 165px; top: 289px; position: fixed; height: 1px; width: 595px" 
                AllowPaging="True" RowHeaderColumn="status" ToolTip="Editar Usuário" 
                onselectedindexchanged="GridView1_SelectedIndexChanged">
                <PagerSettings Mode="NextPreviousFirstLast" PageButtonCount="3" />
                <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                <EmptyDataRowStyle HorizontalAlign="Center" Width="3px" />
                <Columns>
                    <asp:CommandField ButtonType="Image" HeaderText="Editar" 
                        SelectImageUrl="~/imagens/fatia/formulario/editar.png" SelectText="" 
                        ShowCancelButton="False" ShowSelectButton="True">
                        <ItemStyle HorizontalAlign="Center" />
                    </asp:CommandField>
                    <asp:BoundField DataField="numero" HeaderText="Número" 
                        InsertVisible="False" ReadOnly="True" SortExpression="numero" />
                    <asp:BoundField DataField="tipo_ocorrencia" HeaderText="Tipo de Ocorrência" 
                        SortExpression="tipo_ocorrencia" >
                    </asp:BoundField>
                    <asp:BoundField DataField="bairro" HeaderText="Bairro" 
                        SortExpression="bairro" />
                    <asp:BoundField DataField="vitimas_feridas" HeaderText="Vítimas Feridas" 
                        SortExpression="vitimas_feridas" />
                    <asp:BoundField DataField="vitimas_fatais" HeaderText="Vítimas Fatais" 
                        SortExpression="vitimas_fatais" />
                    <asp:BoundField DataField="data_hora" HeaderText="Data e Hora" 
                        SortExpression="data_hora" />
                    <asp:BoundField DataField="status" HeaderText="Status" SortExpression="status">
                        <ItemStyle HorizontalAlign="Left" />
                    </asp:BoundField>
                </Columns>
                <FooterStyle BackColor="#DADADA" Font-Bold="True" Font-Size="4pt" 
                    ForeColor="White" Height="1px" Wrap="False" />
                <PagerStyle BackColor="#284775" ForeColor="White" Height="1px" 
                    HorizontalAlign="Center" Wrap="False" />
                <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" 
                    HorizontalAlign="Left" />
                <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" 
                    Font-Names="Trebuchet MS" />
                <EditRowStyle BackColor="#999999" />
                <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
            </asp:GridView>
    <asp:Panel ID="Panel7" runat="server" 
        style="z-index: 1; left: 23px; top: 105px; position: absolute; height: 19px; width: 36px">
        <asp:Label ID="Label5" runat="server" Text="Nome:" Font-Names="Trebuchet MS" 
            Font-Size="9pt" ForeColor="#000099"></asp:Label>
    </asp:Panel>
    <p>
    </p>
    <p title=".:: SIGOT - Ocorrência">
    </p>
    <p>
    </p>
</asp:Content>


